package com.crm.service.impl;


import com.crm.domain.SysMenu;
import com.crm.mapper.SysMenuMapper;
import com.crm.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class SysMenuServiceImpl implements SysMenuService {
      @Autowired
      private SysMenuMapper sysMenuMapper;
    /**
     * 获取菜单列表
     */
    @Override
    public List<SysMenu> selectMenuList(SysMenu menu) {
       List<SysMenu>  menuList =new ArrayList<>();
       return  menuList;
    }
    /**
     * 根据菜单编号获取详细信息
     */
    @Override
    public String selectMenuById(Long menuId) {
        return sysMenuMapper.selectMenuById(menuId);
    }
    /**
     * 加载对应角色菜单列表树
     */
    @Override
    public Object selectMenuListByRoleId(Long roleId) {
       return  sysMenuMapper.selectMenuListByRoleId(roleId);
    }
    /**
     * 新增保存菜单信息
     *
     * @param menu 菜单信息
     * @return 结果
     */
    @Override
    public Object insertMenu(SysMenu menu) {
        return  sysMenuMapper.insertMenu(menu);
    }
    /**
     * 修改菜单
     */
    @Override
    public Integer updateMenu(SysMenu menu) {
        return sysMenuMapper.updateMenu(menu);
    }

    /**
     * 删除菜单
     */
    @Override
    public Integer deleteMenuById(Long menuId) {
        return sysMenuMapper.deleteMenuById(menuId);
    }
}
